package a.j;

import a.c.e;
import a.j.a.j;

import java.awt.*;
import java.awt.geom.GeneralPath;

public class s
  extends n
  implements md.l_
{
  public static final byte f = 0;
  public static final byte g = 1;
  public static final byte h = 2;
  public static final byte i = 3;
  public static final byte j = 4;
  public static final byte k = 5;
  public static final byte l = 6;
  public static final byte m = 7;
  public static final byte n = 8;
  public static final byte o = 9;
  public static final byte p = 10;
  private byte q;
  private boolean r = true;
  public static boolean s;
  
  public s()
  {
    this((byte)0);
  }
  
  public s(byte paramByte)
  {
    this.q = paramByte;
  }
  
  protected void a(ld paramld, Graphics2D paramGraphics2D, boolean paramBoolean)
  {
    Shape localShape = a(paramld);
    a(paramld, paramGraphics2D, localShape);
    b(paramld, paramGraphics2D, localShape);
  }
  
  private Shape a(ld paramld)
  {
    boolean bool = ld.E;
    double d1;
    double d2;
    double d3;
    double d4;
    if ((bool) || (paramld != null))
    {
      d1 = paramld.a();
      d2 = paramld.b();
      d3 = paramld.c();
      d4 = paramld.d();
      if (bool) {
        break label63;
      }
      if (!ld.D) {}
    }
    else
    {
      d1 = 0.0D;
      d2 = 0.0D;
      d3 = 1.0D;
      d4 = 1.0D;
    }
    label63:
    GeneralPath localGeneralPath;
    switch (this.q)
    {
    case 2: 
      return new Ellipse2D.Double(d1, d2, d3, d4);
    case 0: 
    case 6: 
      return new Rectangle2D.Double(d1, d2, d3, d4);
    case 1: 
      return new RoundRectangle2D.Double(d1, d2, d3, d4, 8.0D, 8.0D);
    case 3: 
      localGeneralPath = new GeneralPath(0, 9);
      localGeneralPath.moveTo((float)(d1 + d3 * 0.1D), (float)d2);
      localGeneralPath.lineTo((float)(d1 + d3), (float)d2);
      localGeneralPath.lineTo((float)(d1 + d3 * 0.9D), (float)(d2 + d4));
      localGeneralPath.lineTo((float)d1, (float)(d2 + d4));
      localGeneralPath.closePath();
      return localGeneralPath;
    case 4: 
      localGeneralPath = new GeneralPath(0, 9);
      localGeneralPath.moveTo((float)d1, (float)(d2 + d4 / 2.0D));
      localGeneralPath.lineTo((float)(d1 + d3 * 0.1D), (float)d2);
      localGeneralPath.lineTo((float)(d1 + d3 * 0.9D), (float)d2);
      localGeneralPath.lineTo((float)(d1 + d3), (float)(d2 + d4 / 2.0D));
      localGeneralPath.lineTo((float)(d1 + d3 * 0.9D), (float)(d2 + d4));
      localGeneralPath.lineTo((float)(d1 + d3 * 0.1D), (float)(d2 + d4));
      localGeneralPath.closePath();
      return localGeneralPath;
    case 5: 
      localGeneralPath = new GeneralPath(0, 9);
      localGeneralPath.moveTo((float)(d1 + d3 / 2.0D), (float)d2);
      localGeneralPath.lineTo((float)(d1 + d3), (float)(d2 + d4));
      localGeneralPath.lineTo((float)d1, (float)(d2 + d4));
      localGeneralPath.closePath();
      return localGeneralPath;
    case 7: 
      double d5 = Math.sqrt(2.0D);
      double d6 = d3 / (2.0D + d5);
      double d7 = d4 / (2.0D + d5);
      localGeneralPath = new GeneralPath(0, 9);
      localGeneralPath.moveTo((float)d1, (float)(d2 + d7));
      localGeneralPath.lineTo((float)(d1 + d6), (float)d2);
      localGeneralPath.lineTo((float)(d1 + d3 - d6), (float)d2);
      localGeneralPath.lineTo((float)(d1 + d3), (float)(d2 + d7));
      localGeneralPath.lineTo((float)(d1 + d3), (float)(d2 + d4 - d7));
      localGeneralPath.lineTo((float)(d1 + d3 - d6), (float)(d2 + d4));
      localGeneralPath.lineTo((float)(d1 + d6), (float)(d2 + d4));
      localGeneralPath.lineTo((float)d1, (float)(d2 + d4 - d7));
      localGeneralPath.closePath();
      return localGeneralPath;
    case 8: 
      localGeneralPath = new GeneralPath(0, 9);
      localGeneralPath.moveTo((float)d1, (float)(d2 + d4 * 0.5D));
      localGeneralPath.lineTo((float)(d1 + d3 * 0.5D), (float)d2);
      localGeneralPath.lineTo((float)(d1 + d3), (float)(d2 + d4 * 0.5D));
      localGeneralPath.lineTo((float)(d1 + d3 * 0.5D), (float)(d2 + d4));
      localGeneralPath.closePath();
      return localGeneralPath;
    case 9: 
      localGeneralPath = new GeneralPath(0, 9);
      localGeneralPath.moveTo((float)d1, (float)(d2 + d4));
      localGeneralPath.lineTo((float)(d1 + d3 * 0.25D), (float)d2);
      localGeneralPath.lineTo((float)(d1 + d3 * 0.75D), (float)d2);
      localGeneralPath.lineTo((float)(d1 + d3), (float)(d2 + d4));
      localGeneralPath.closePath();
      return localGeneralPath;
    case 10: 
      localGeneralPath = new GeneralPath(0, 9);
      localGeneralPath.moveTo((float)d1, (float)d2);
      localGeneralPath.lineTo((float)(d1 + d3), (float)d2);
      localGeneralPath.lineTo((float)(d1 + d3 * 0.75D), (float)(d2 + d4));
      localGeneralPath.lineTo((float)(d1 + d3 * 0.25D), (float)(d2 + d4));
      localGeneralPath.closePath();
      return localGeneralPath;
    }
    return new Rectangle2D.Double(d1, d2, d3, d4);
  }
  
  protected void a(ld paramld, Graphics2D paramGraphics2D, Shape paramShape)
  {
    if (!paramld.s())
    {
      Paint localPaint = h(paramld, paramGraphics2D);
      if (!ld.E)
      {
        if (localPaint != null) {
          paramGraphics2D.setPaint(localPaint);
        }
      }
      else {
        paramGraphics2D.fill(paramShape);
      }
    }
  }
  
  protected Color d(ld paramld, boolean paramBoolean)
  {
    boolean bool = ld.E;
    Object localObject1 = super.d(paramld, paramBoolean);
    if (b())
    {
      if (bool) {
        break label150;
      }
      if (localObject1 != null)
      {
        e locale = paramld.n();
        if ((bool) || (locale != null))
        {
          j localj = j.a(locale.g());
          if (((bool) || (localj != null)) && (localj.m(locale)))
          {
            Object localObject2 = localObject1;
            int i1 = localj.q(locale);
            if (i1 > 0) {
              localObject2 = new Color(Math.max(((Color)localObject1).getRed() - 20 * i1, 0), Math.max(((Color)localObject1).getGreen() - 20 * i1, 0), Math.max(((Color)localObject1).getBlue() - 20 * i1, 0), ((Color)localObject1).getAlpha());
            }
            localObject1 = localObject2;
          }
        }
      }
    }
    label150:
    return localObject1;
  }
  
  protected void b(ld paramld, Graphics2D paramGraphics2D, Shape paramShape)
  {
    boolean bool2 = ld.E;
    boolean bool1 = ld.D;
    if (!bool2) {
      if (this.q == 6)
      {
        localColor = d(paramld, j(paramld, paramGraphics2D));
        if (!bool2)
        {
          if (localColor == null) {
            return;
          }
          paramGraphics2D.setColor(localColor);
          c(paramld, paramGraphics2D, true);
        }
        if (bool2) {
          break label81;
        }
        if (!bool1) {
          return;
        }
      }
    }
    Color localColor = a(paramld, j(paramld, paramGraphics2D));
    label81:
    if (localColor != null)
    {
      Stroke localStroke = paramGraphics2D.getStroke();
      paramGraphics2D.setStroke(paramld.r());
      if (!bool2)
      {
        paramGraphics2D.setColor(localColor);
        if (this.q == 2)
        {
          pc localpc = (pc)paramGraphics2D.getRenderingHint(kg.z);
          Object localObject = paramGraphics2D.getRenderingHint(RenderingHints.KEY_ANTIALIASING);
          if (!bool2)
          {
            if (!RenderingHints.VALUE_ANTIALIAS_ON.equals(localObject)) {
              if ((bool2) || (localpc != null))
              {
                if (bool2) {
                  break label225;
                }
                if (localpc.c()) {}
              }
              else
              {
                paramGraphics2D.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
                paramGraphics2D.draw(paramShape);
                if (bool2) {
                  break label234;
                }
                paramGraphics2D.setRenderingHint(RenderingHints.KEY_ANTIALIASING, localObject);
                if (!bool1) {
                  break label233;
                }
              }
            }
            if (bool2) {
              break label234;
            }
            paramGraphics2D.draw(paramShape);
          }
          label225:
          if (!bool1) {
            break label233;
          }
        }
      }
      paramGraphics2D.draw(paramShape);
      label233:
      label234:
      paramGraphics2D.setStroke(localStroke);
    }
  }
  
  private void c(ld paramld, Graphics2D paramGraphics2D, boolean paramBoolean)
  {
    boolean bool = ld.E;
    double d1 = paramld.a();
    double d2 = paramld.b();
    double d3 = paramld.c();
    double d4 = paramld.d();
    Paint localPaint = paramGraphics2D.getPaint();
    Color localColor1 = paramGraphics2D.getColor();
    Color localColor2 = localColor1.brighter();
    Color localColor3 = localColor1.darker();
    if (!bool)
    {
      if (!paramBoolean)
      {
        if (bool) {
          break label95;
        }
        paramGraphics2D.setColor(localColor3);
      }
    }
    else {
      if (!ld.D) {
        break label94;
      }
    }
    if (localPaint != localColor1) {
      paramGraphics2D.setColor(localColor1);
    }
    label94:
    label95:
    paramGraphics2D.setColor(paramBoolean ? localColor2 : localColor3);
    Rectangle2D.Double localDouble = hb.a().k;
    localDouble.setFrame(d1, d2, 1.0D, d4);
    paramGraphics2D.fill(localDouble);
    localDouble.setFrame(d1 + 1.0D, d2, d3 - 2.0D, 1.0D);
    paramGraphics2D.fill(localDouble);
    paramGraphics2D.setColor(paramBoolean ? localColor3 : localColor2);
    localDouble.setFrame(d1 + 1.0D, d2 + d4 - 1.0D, d3 - 1.0D, 1.0D);
    paramGraphics2D.fill(localDouble);
    localDouble.setFrame(d1 + d3 - 1.0D, d2, 1.0D, d4 - 1.0D);
    paramGraphics2D.fill(localDouble);
    paramGraphics2D.setPaint(localPaint);
  }
  
  public void a(byte paramByte)
  {
    this.q = paramByte;
  }
  
  public byte a()
  {
    return this.q;
  }
  
  public void a(boolean paramBoolean)
  {
    this.r = paramBoolean;
  }
  
  public boolean b()
  {
    return this.r;
  }
  
  protected Shape b(ld paramld)
  {
    return a(paramld);
  }
  
  public boolean a(ld paramld, double paramDouble1, double paramDouble2)
  {
    return a(paramld).contains(paramDouble1, paramDouble2);
  }
}



/* Location:           E:\idea\

 * Qualified Name:     a.j.s

 * JD-Core Version:    0.7.0.1

 */